package com.witframework.util;

import org.apache.commons.lang.StringUtils;

import com.witframework.WitException;
import com.witframework.WitWarning;

public class Assert {
	public static void isEmpty(String str,String message){
		if(StringUtils.isEmpty(str)){
			if(StringUtils.isEmpty(message)){
				message="需要的字符串为空";
			}
			throw new WitException(message);
		}
	}
	public static void isNull(Object obj,String message){
		if((null==obj)){
			if(StringUtils.isEmpty(message)){
				message="需要的对象为：null";
			}
			throw new WitException(message);
		}
	}
	public static void isNullWarning(Object obj,String message){
		if(null==obj)
			new WitWarning(message);
	}
}
